package com.example.prueba2;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
 
public class AndroidTabLayoutActivity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
         
        TabHost tabHost = getTabHost();
         
        // Tab for home
        TabSpec homespec = tabHost.newTabSpec("Home");
        // setting Title and Icon for the Tab
        homespec.setIndicator("Home", getResources().getDrawable(R.drawable.icon_hom_tab));
        Intent homeIntent = new Intent(this, HomeActivity.class);
        homespec.setContent(homeIntent);
         
        // Tab for entrevista
        TabSpec entrevistaspec = tabHost.newTabSpec("Entrevista");        
        entrevistaspec.setIndicator("Entrevista", getResources().getDrawable(R.drawable.icon_entrevista_tab));
        Intent entrevistaIntent = new Intent(this, EntrevistaActivity.class);
        entrevistaspec.setContent(entrevistaIntent);
         
        // Tab for datos
        TabSpec datosspec = tabHost.newTabSpec("Datos");
        datosspec.setIndicator("Datos", getResources().getDrawable(R.drawable.icon_datos_tab));
        Intent datosIntent = new Intent(this, DatosActivity.class);
        datosspec.setContent(datosIntent);
         
        // Adding all TabSpec to TabHost
        tabHost.addTab(homespec); // Adding home tab
        tabHost.addTab(entrevistaspec); // Adding entrevista tab
        tabHost.addTab(datosspec); // Adding datos tab
    }
}